<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>弓友之家</title>
    <link rel="stylesheet" href="css/mui.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />
    <link rel="stylesheet" href="css/style.css" />
    <style>
    	.mui-slider-indicator{bottom: 8px;}
    </style>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">赛场回顾</h1>
		<a class="mui-icon mui-icon-more-filled mui-pull-right shareBtn"></a>
	</header>
	<div class="mui-content">
		<!--轮播图-->
		<div id="slider" class="mui-slider" >
			<div class="mui-slider-group mui-slider-loop">
				
			</div>
			<div class="mui-slider-indicator">
				
			</div>
		</div>
		<div class="game-title mui-row mui-text-center"> 
			<div class="mui-col-xs-6"><a data-href='game-list.html'>往期赛场回顾</a></div>
			<div class="mui-col-xs-6"><a data-href='honor.html'>荣誉墙</a></div>
		</div>
		<div class="new-game-rank">
			<header class="title"></header>
		</div>
	</div>
	<!--分享-->
	<div class="shareWx mui-hidden"> 
		<ul class="mui-list-unstyled">
			<li class="tel"><a href="javascript:void(0)" onclick="shareWeixinMessage(1)">微信好友</a></li>
			<li class="qq"><a href="javascript:void(0)" onclick="shareWeixinMessage(2)">朋友圈</a></li>
		</ul>
		<button type="button" class="cancleShare">取消</button>
	</div>
	<script type="text/javascript" src="js/mui.min.js" ></script>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/mui.zoom.js" ></script>
	<script type="text/javascript" src="js/mui.previewimage.js" ></script>
	<script type="text/javascript" charset="utf-8">
      	mui.init();
      	//轮播
      	var tit="",des="",img="";
      	mui.ajax(H_SRC+'/amier/index/match_review',{
			data:{
				token:token
			},
			dataType:'json',
			type:'post',
			timeout:10000,             
			success:function(data){
				var dataurl=data.data;
				if(data.code == 1){
					//轮播图
					var lb="",dot="";
					lb+='<div class="mui-slider-item mui-slider-item-duplicate"><img src="'+H_SRC+''+dataurl.imgs[dataurl.imgs.length-1].img_url+'"></div>'
					for(var i=0;i<dataurl.imgs.length;i++){
						lb+='<div class="mui-slider-item"><img src="'+H_SRC+''+dataurl.imgs[i].img_url+'" /></div>';
						dot+='<div class="mui-indicator"></div>';
					}
					lb+='<div class="mui-slider-item mui-slider-item-duplicate"><img src="'+H_SRC+''+dataurl.imgs[0].img_url+'"></div>';
					$(".mui-slider-group").html(lb);
					$(".mui-slider-indicator").html(dot);
					var href="";
					$("#slider").on("tap","a",function(){
						gid=$(this).attr("data-href");
						mui.openWindow({
							url:'goods-list-page.html',
							id:'goods-list-page.html',
							createNew:true,
							show: {
								autoShow: true,
								aniShow: 'slide-in-right',
								duration: 200,
							},
							extras:{
								gid:gid
							}
						});
					})
					var slider = mui("#slider");
      				slider.slider({interval: 4000}); 
      				
      				//赛事标题
      				$(".new-game-rank .title").html(dataurl.match.title)
      				
      				//冠亚军排行
      				var rank="";
      				for(var i=0;i<dataurl.team_list.length;i++){
      					rank+='<div class="new-rank">'; 
      					rank+='<h3>'+dataurl.team_list[i].ranking_name+'</h3>';
						rank+='<h4>'+dataurl.team_list[i].team_name+'</h4><a href="javascript:void(0)" data-id="'+dataurl.team_list[i].team_id+'">查看详情</a><div class="mui-row">';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.team_list[i].head_pic1+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.team_list[i].head_pic1+'" data-preview-src="" data-preview-group="'+dataurl.team_list[i].team_id+'"/></div><p class="name">'+dataurl.team_list[i].member_1+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.team_list[i].head_pic2+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.team_list[i].head_pic2+'" data-preview-src="" data-preview-group="'+dataurl.team_list[i].team_id+'"/></div><p class="name">'+dataurl.team_list[i].member_2+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.team_list[i].head_pic3+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.team_list[i].head_pic3+'" data-preview-src="" data-preview-group="'+dataurl.team_list[i].team_id+'"/></div><p class="name">'+dataurl.team_list[i].member_3+'</p></div></div>';
						rank+='<div class="mui-col-xs-3"><div class="con"><div class="img" style="background:url('+H_SRC+''+dataurl.team_list[i].head_pic4+') no-repeat center;background-size:cover;"><img src="'+H_SRC+''+dataurl.team_list[i].head_pic4+'" data-preview-src="" data-preview-group="'+dataurl.team_list[i].team_id+'"/></div><p class="name">'+dataurl.team_list[i].member_4+'</p></div></div>';
						rank+='</div></div></div>';
      				}
      				$(".new-game-rank").append(rank);
      				mui.previewImage();
      				$(".new-game-rank").on("tap","a",function(){
						mid=$(this).attr("data-id");
						mui.openWindow({
							url:'integralrank-page02.html',
							id:'integralrank-page02.html',
							createNew:true,
							show: {
								autoShow: true,
								aniShow: 'slide-in-right',
								duration: 200,
							},
							extras:{
								mid:mid
							}
						});
					})
      				
      				tit=data.share_msg.share_title;
					des=data.share_msg.share_desc;
					img=H_SRC+data.share_msg.share_pic;
				}else{
					mui.toast(data.msg);
				}
			},
			error:function(){
				
			}
		}) 
      	$(".game-title").on("tap","a",function(){
      		var href=$(this).attr("data-href");
      		mui.openWindow({
				url:href,
				id:href,
				createNew:true,
				show: {
					autoShow: true,
					aniShow: 'slide-in-right',
					duration: 200
				}
			});
      	})
      	
      	function shareWeixinMessage(type){
			var type=type;
			if(type==1){
				var secne="WXSceneSession"
			}else{
				var secne="WXSceneTimeline"
			}
			sharewx.send( 
				{ 
					title:tit,
					content:des, 
					href:H_SRC+'/match_review',
					thumbs: [img], 
		        	pictures: [img], 
					extra:{scene:secne}
				}, 
				function(){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "分享成功！" );
				}, function(e){
					mask.close();
					$(".shareWx").addClass("mui-hidden");
					mui.toast( "取消分享");
				}
			);
		}
    </script>
</body>
</html>